package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.entity.NursingPlan;
import com.zzyl.vo.NursingPlanVo;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

/**
 * @Description NursingPlanMapper
 * @Author liangDong
 * @Date 2025-05-08  15:37
 */
@Mapper
public interface NursingPlanMapper {
    List<NursingPlanVo> selectAll();

    @Options(useGeneratedKeys = true,keyProperty = "id")
    @Insert("insert into nursing_plan ( sort_no, plan_name, status, create_time, create_by, remark)" +
            "value (#{sortNo},#{planName},#{status},#{createTime},#{createBy},#{remark})")
    void insert(NursingPlan nursingPlan);

    Page<NursingPlan> page(String name, Integer status);

    NursingPlanVo getById(Long id);

    void update(NursingPlan nursingPlan);

    @Update("update nursing_plan set status = #{status} where id = #{id}")
    void updateStatus(Long id, Integer status);

    @Delete("delete from nursing_plan where id = #{id}")
    void deleteById(Long id);

    List<Map<String, Object>> getCountList();
}
